package com.comet.service;

import com.comet.domain.Course;
import com.comet.service.fallback.CourseServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "MicroBot-Course-Service", fallback = CourseServiceFallback.class)
public interface CourseService {

    @GetMapping("/api/v1/video/find_video_by_id")
    Course findById(@RequestParam("courseId") int courseId);

    @PostMapping("/api/v1/video/save_video")
    int save(@RequestBody Course course);

    // 扣减库存
    @GetMapping("/api/v1/video/deduct_stock_by_sku_id")
    int deductStockBySkuId(@RequestParam("skuId") Integer skuId, @RequestParam("num") Integer num);
}
